<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <button onclick="alert(111)">11</button>

    <script>
        var oBtn = document.getElementsByTagName('button')[0] ;


        oBtn.onclick = function() {
            console.log(333);
        }

        setTimeout(function(){
            // DOM 0级事件都可以发生覆盖  Onclick重新赋任何值都可以移除事件   一般建议写null
            oBtn.onclick = null ;
        } , 3000)


    </script>
    
</body>
</html>